from pyframe.exceptions.xml_serializable_exception import XmlSerializableException

from source import Source
from source_request import SourceRequest

def create(type = None, input = None):

	if(type is None):
		return Source(input)

	if(type == 'request'):
		return SourceRequest(input)

	raise XmlSerializableException(type, 'source-type-unsupported')